package com.zhou.vartype

/**
  * String字符串相关的一些知识
  *
  * @author ZhOu
  * @date 2018/10/26
  */
object StringAccum {

  def main(args: Array[String]): Unit = {
    var str = new StringBuilder();
    //字符串用++，字符用+，数字会根据assic码转换
    str ++= "This is ";
    str += 'A';
    str += 98;
    println(str.toString())

    printf("字符串=%s \t 整型=%d \t 浮点型=%f \n", "ceshi", 12, 0.12)

    val s1 = "这是一段测试";
    val s2 = "那是一段测试的结果";
    println(s1.equals(s2))

    //区域匹配，还可以配置是否忽略大小写
    println(s1.regionMatches(1, s2, 1, 4))
  }
}
